﻿<UserControl x:Class="InkCanvasControls.Palettes.PenPalette"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:self="clr-namespace:InkCanvasControls"
    Height="300" Width="300">
    <UserControl.Resources>
        <self:ThicknessToFillValueConverter x:Key="ThicknessToFill"/>
    </UserControl.Resources>

    <Grid>
        <StackPanel x:Name="Styles" Orientation="Horizontal">
            <GroupBox Header="Colour">
                <StackPanel x:Name="Colours" Orientation="Vertical">
                    <RadioButton x:Name="BlackColour" VerticalAlignment="Center" Margin="5" Checked="ColourButton_Checked">
                        <Line X1="0" Y1="5" X2="50" Y2="5" Stroke="Black" StrokeThickness="{Binding SelectedThickness}"/>
                    </RadioButton>
                    <RadioButton x:Name="RedColour" VerticalAlignment="Center" Margin="5" Checked="ColourButton_Checked">
                        <Line X1="0" Y1="5" X2="50" Y2="5" Stroke="Red" StrokeThickness="{Binding SelectedThickness}"/>
                    </RadioButton>
                    <RadioButton x:Name="BlueColour" VerticalAlignment="Center" Margin="5" Checked="ColourButton_Checked">
                        <Line X1="0" Y1="5" X2="50" Y2="5" Stroke="Blue" StrokeThickness="{Binding SelectedThickness}"/>
                    </RadioButton>
                </StackPanel>
            </GroupBox>

            <GroupBox Header="Width">
                <StackPanel x:Name="Widths" Orientation="Vertical">
                    <RadioButton x:Name="ThinWidth" VerticalAlignment="Center" Margin="5" Checked="WidthButton_Checked">
                        <Line X1="0" Y1="5" X2="50" Y2="5" Stroke="{Binding SelectedBrush}" StrokeThickness="1"/>
                    </RadioButton>
                    <RadioButton x:Name="MediumWidth" VerticalAlignment="Center" Margin="5" Checked="WidthButton_Checked">
                        <Line X1="0" Y1="5" X2="50" Y2="5"  Stroke="{Binding SelectedBrush}" StrokeThickness="2"/>
                    </RadioButton>
                    <RadioButton x:Name="ThickWidth" VerticalAlignment="Center" Margin="5" Checked="WidthButton_Checked">
                        <Line X1="0" Y1="5" X2="50" Y2="5"  Stroke="{Binding SelectedBrush}" StrokeThickness="4"/>
                    </RadioButton>
                </StackPanel>
            </GroupBox>

            <GroupBox Header="Tip">
                <StackPanel x:Name="Tips" Orientation="Vertical" VerticalAlignment="Center">
                    <RadioButton x:Name="SquareTip" Margin="5" Checked="TipButton_Checked">
                        <Rectangle Width="{Binding SelectedThickness, Converter={StaticResource ThicknessToFill}}"
                               Height="{Binding SelectedThickness, Converter={StaticResource ThicknessToFill}}"
                               Fill="{Binding SelectedBrush}"/>
                    </RadioButton>
                    <RadioButton x:Name="RoundTip" Margin="5" Checked="TipButton_Checked">
                        <Ellipse Width="{Binding SelectedThickness, Converter={StaticResource ThicknessToFill}}"
                               Height="{Binding SelectedThickness, Converter={StaticResource ThicknessToFill}}"
                               Fill="{Binding SelectedBrush}"/>
                    </RadioButton>

                </StackPanel>
            </GroupBox>

        </StackPanel>
    </Grid>
</UserControl>
